﻿<phone:PhoneApplicationPage
    x:Class="TanZim_vai_MVVM_MAP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Maps.Toolkit;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:controltoolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:GoogleAds="clr-namespace:GoogleAds;assembly=GoogleAds"
    xmlns:bar="clr-namespace:BindableApplicationBar;assembly=BindableApplicationBar"
    xmlns:BindHelper="clr-namespace:RelativeSourceBinding"
    xmlns:c4f="clr-namespace:Coding4Fun.Toolkit.Controls;assembly=Coding4Fun.Toolkit.Controls"
    
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
         
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" 
    >

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="RestaurantItem">

            <Grid Background="{StaticResource PhoneAccentBrush}" Width="320">
                <Grid Margin="4" Background="#6D000000">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.33*"/>
                        <RowDefinition Height="0.33*"/>

                    </Grid.RowDefinitions>

                    <TextBlock Margin="5" x:Name="NameBlock" TextWrapping="NoWrap" Text="{Binding Content}" 
                               FontSize="32"
                               VerticalAlignment="Center"  d:LayoutOverrides="Width" Grid.Column="1" 
                               TextTrimming="WordEllipsis" FontFamily="Segoe WP Light"/>

                    <TextBlock Margin="5" x:Name="Description" TextWrapping="NoWrap" 
                               Text="{Binding Vicinity}" FontSize="20"
                               VerticalAlignment="Center"  Grid.Column="1" d:LayoutOverrides="Width" 
                               Grid.Row="1" TextTrimming="WordEllipsis"
                               FontFamily="Segoe WP Light"/>
                    
                    

                </Grid>
            </Grid>

        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <!--DataContext="{Binding Source={StaticResource Locator}, Path=Main}"-->

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>            
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
         
       
        <Grid Grid.Row="0">
            <StackPanel Name="_autoComplete" Visibility="Collapsed">
                <TextBlock Text="Select Bank" Margin="13,0,0,0" />
                <controltoolkit:AutoCompleteBox Name="_autoBankCompleteBox"/>
                <TextBlock Text="Select Area" Margin="13,0,0,0"/>
                <controltoolkit:AutoCompleteBox Name="_autoAreaCompleteBox"/>
                <Button Content="Search" Name="_search" Click="_search_Click"/>
            </StackPanel>            
        </Grid>
        <Grid Grid.Row="1">            
            <StackPanel Name="_radiusSearch" Visibility="Collapsed">
                <TextBlock Text="Select Bank" Margin="13,0,0,0"/>
                <controltoolkit:AutoCompleteBox Name="_autoNearCompleteBox"/>
                <TextBlock Text="Enter a Radius in Meter" Margin="138,0,0,0"/>
                <TextBox   Name="_radius" Width="200" InputScope="Number"/>
                <Button Name="_radiusLoad" Click="_radiusLoad_Click" Content="Search"/>
            </StackPanel>
        </Grid>
        <!--TitlePanel contains the name of the application and page title-->
        

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="2" Margin="12,0,12,0">
            
              <StackPanel Height="80" VerticalAlignment="Top">
                <!--<ad:InneractiveAd
                    xmlns:ad="clr-namespace:Inneractive.Ad;assembly=Inneractive.Ad"
                    AppID="NerdCats_shakib_al_hasan_1_WP"
                    AdType="IaAdType_Banner"
                    ReloadTime="60"
                    Name="InneractiveXamlAd"
                    OptionalAdWidth="320" 
                    OptionalAdHeight="53"/>-->
                <GoogleAds:AdView AdUnitID="ca-app-pub-2241081181877780/7949187355"
                          Format="Banner"
                          
                          VerticalAlignment="Bottom" />
            </StackPanel>

            <maps:Map x:Name="maps" ZoomLevel="12" Center="23.814921, 90.366253" Tap="maps_Tap" Margin="0,53,0,0">
                
                    <!--<toolkit:MapExtensions.Children>
                        <toolkit:MapItemsControl Name="mapItems" ItemsSource="{Binding Main.Placemarks, Source={StaticResource Locator}, Mode=OneWay}">
                            <toolkit:MapItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <toolkit:Pushpin Content="{Binding shortname}" GeoCoordinate="{Binding GeoCoordinate}"/>
                                </DataTemplate>
                            </toolkit:MapItemsControl.ItemTemplate>
                        </toolkit:MapItemsControl>
                        <toolkit:Pushpin Name="MyPushpin"  Content="I'm Here!" Background="#FF3CD303" GeoCoordinate="myGeoCoordinate"  />
                    </toolkit:MapExtensions.Children>-->
                </maps:Map>
                <!--<StackPanel Orientation="Horizontal">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"/>
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>
                    </Grid>
                    <Slider Grid.Column="0"/>
                    <Slider Grid.Column="1"/>
                </StackPanel>-->
                
             
        </Grid>
        <Slider x:Name="PitchSlider" Grid.RowSpan="3" Orientation="Vertical"
                HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="211"
                Width="45" Margin="0,0,12,147" Minimum="0" Maximum="70" Value="0" 
                ValueChanged="PitchValueChanged" 
                Foreground="#FF60BEFF"/>
        <Slider x:Name="HeadingSlider" Grid.RowSpan="3" VerticalAlignment="Bottom"
                HorizontalAlignment="Center" Height="80" Width="250" Margin="115,0,115,-20"
                Maximum="540" Minimum="180" Value="360" ValueChanged="HeadingValueChanged" 
                Foreground="#FF60BEFF" Grid.Row="2"/>
        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>
  
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Default">
            <shell:ApplicationBarIconButton  IconUri="Assets\gps_searching-256.png" Text="current position" Click="ApplicationBarIconButton_Click"/>
            <shell:ApplicationBarIconButton  IconUri="Assets\search-128.png" Text="find" Click="ApplicationBarIconButton2_Click"/>
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>-->
            <shell:ApplicationBarIconButton IconUri="Assets\appbar.show.route.png" Text="show nearest booth" Click="ApplicationBarIconButton4_Click"/>
            <shell:ApplicationBarIconButton IconUri="Assets\refresh-128.png" Text="load_radius" Click="ApplicationBarIconButton5_Click"/>
            
            
            
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>